home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 002a / be310.zip / S_AGAIN.CHS < prev    next >
Text File  |  1993-06-01  |  999b  |  32 lines

  1. /* CHESS FUNCTION(S): forward_again, back_again
  2. /*              DATE: 3/1/93
  3. /*            AUTHOR: C. Schanck
  4. /*
  5. /*       DESCRIPTION: These two function search for the last target string, 
  6. /* but in a specific direction.  Alter the search modifiers to taste.  
  7. /* The modifiers could be expanded to actually check what the current system
  8. /* defaults are, and simply toggle the 'b' flag on and off, but I leave that 
  9. /* as an exercise for the reader... ;-)
  10. forward_again
  11. {  
  12.    if(Cursor_right()) /* move over one character, so as not to match 
  13.                       /* the same text again
  14.       return(Search("~~ ~ia~ ~~")); /* search.....
  15.    else
  16.       return(0);
  17. }
  18. back_again
  19. {               
  20.    int i;
  21.    if(ask("file_column")==1)
  22.    {                    /* move back one character
  23.       if(Cursor_up()==0)
  24.          return(0);
  25.       else
  26.          End_line();
  27.    }
  28.    else
  29.       if(Cursor_right()==0)
  30.          return(0);
  31.    return(Search("~~ ~bia~"));   /* search
  32. }